package com.weitu.contractor.service.impl;

import com.weitu.contractor.entity.BusinessQualificationHistory;
import com.weitu.contractor.entity.BusinessQualificationHistoryCriteria;
import com.weitu.contractor.mapper.BusinessQualificationHistoryMapper;
import com.weitu.contractor.service.BusinessQualificationHistoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class BusinessQualificationHistoryServiceImpl implements BusinessQualificationHistoryService {
    private final BusinessQualificationHistoryMapper businessQualificationHistoryMapper;

    private static final Logger logger = LoggerFactory.getLogger(BusinessQualificationHistoryServiceImpl.class);

    @Autowired
    public BusinessQualificationHistoryServiceImpl(BusinessQualificationHistoryMapper businessQualificationHistoryMapper) {
        this.businessQualificationHistoryMapper = businessQualificationHistoryMapper;
    }

    @Override
    public int countByCriteria(BusinessQualificationHistoryCriteria example) {
        int count = this.businessQualificationHistoryMapper.countByCriteria(example);
        logger.debug("count: {}", count);
        return count;
    }

    @Override
    public BusinessQualificationHistory selectByPrimaryKey(String id) {
        return this.businessQualificationHistoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<BusinessQualificationHistory> selectByCriteria(BusinessQualificationHistoryCriteria example) {
        return this.businessQualificationHistoryMapper.selectByCriteria(example);
    }

    @Override
    @Transactional
    public int deleteByPrimaryKey(String id) {
        return this.businessQualificationHistoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(BusinessQualificationHistory record) {
        return this.businessQualificationHistoryMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int updateByCriteriaSelective(BusinessQualificationHistory record, BusinessQualificationHistoryCriteria example) {
        return this.businessQualificationHistoryMapper.updateByCriteriaSelective(record, example);
    }

    @Override
    @Transactional
    public int insertSelective(BusinessQualificationHistory record) {
        return this.businessQualificationHistoryMapper.insertSelective(record);
    }
}